<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
    <title>方法使用clcik</title>
</head>

<body>
    <div id="box">
        <button @click="show">显示</button>
    </div>
    <script>
        new Vue({
            el: '#box',
            data: {
                name: "格力空调",
                price: 8689
            },
            methods: {
                show: function() {
                    alert("商品名称:" + this.name + "商品价格:" + this.price + "元");
                }
            },
        })
    </script>
</body>

</html>